<?php /*
	
*/ ?>
<?php
include("system/config.inc.php");
$donotinclude = 1;
if(!isset($_SESSION['memberid']))
{
	header("location:customerlogin.php?cond=chngpass");
die();	
}

if(isset($_REQUEST['Submit']) && trim($_REQUEST['Submit'])=='Submit') {
	$memberId =  $_SESSION['memberid'];
	$old_password=md5($_REQUEST['old_password']);
	$new_password=md5($_REQUEST['new_password']);
	$sql2="select * from tblcustomers where intcusid='$memberId'";
	$res2=$n02586916_db->select($sql2);
	if(count($res2)>0) {
		$pass=$res2[0]['varcustpassword'];
	}
	if($pass!=$old_password) {
		header("location:changepass.php?msg=oldnomatch");
	    die();
	}
	$sql="update tblcustomers set  varcustpassword = '$new_password' WHERE intcusid ='$memberId'";
	$update_pass=mysql_query($sql);
	header("location:changeaccountinfo.php");
	die();
}
?>
<?php include("inc/head.inc.php") ?>
<script language="javascript" src="js/changepass.js"></script>
<body>
<form name="change" action="" method="post">
<table width="824" border="0" cellpadding="0" cellspacing="0"  align="center">
  
  <tr>
    <td class="headerclass"><?php include(INC."top.inc.php") ?></td>
  </tr>
  <tr>
    <td valign="top" class="maincontainer"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr><td valign="top"class="leftmenuback"><?php include(INC."left.inc.php") ?></td>
        <td valign="top">
		<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
        <tr>
          <td height="23" class="head"><div class="pageheader">Change Your Password</div></td>
        </tr>
		
        <tr>
          <td align="center"><span class="fontsmall msg">
            <?php
			  if(isset($_REQUEST['msg']))
			  {
				echo $mess[$_REQUEST['msg']]; 
			  }
			 ?>
          </span></td>
        </tr>
        <tr>
          <td valign="top" style="padding-top:5px;"><table width="100%"  border="0" align="center" cellpadding="2" cellspacing="2" class="proborder">

            <tr>
              <td width="6%" height="25" class="fontstyle3">&nbsp;</td>
              <td width="28%" class="fntstyle">Old Password </td>
              <td width="2%" class="fontsmall"><strong>:</strong></td>
              <td width="64%" class="font"><input name="old_password" type="password" class="feature_headingbg" id="old_password" /></td>
            </tr>
            <tr>
              <td class="font">&nbsp;</td>
              <td class="fntstyle">New Password </td>
              <td class="font"><strong>:</strong></td>
              <td class="font"><input name="new_password" type="password" class="feature_headingbg" id="new_password" /></td>
            </tr>
            <tr>
              <td class="font">&nbsp;</td>
              <td class="fntstyle">Confirm password </td>
              <td class="font"><strong>:</strong></td>
              <td class="font"><input name="confirm_password" type="password" class="feature_headingbg" id="confirm_password" /></td>
            </tr>
            <tr>
              <td colspan="4" align="center"> <input name="Submit" type="submit" class="btn" onClick="return confirmsubmit();" value="Submit"/>
			  <input name="Submit2" type="reset" class="btn" value="Reset" />
               
               </td>
            </tr>
          </table></td>
        </tr> 
      </table>		</td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td><?php include "inc/bottom.inc.php"; ?></td>
  </tr>
</table>
</form>
</body>
</html>
